package com.group.finance.controller;


import com.group.commons.util.ResponseInfo;
import com.group.commons.util.ResponseStatus;
import com.group.finance.entity.Balance;
import com.group.finance.entity.Deal;
import com.group.finance.service.impl.BalanceServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  余额记录
 * </p>
 *
 * @author zgc
 * @since 2022-06-07
 */
@RestController
@RequestMapping("/balance")
public class BalanceController {

    @Resource
    private BalanceServiceImpl balanceService;

    //查询余额记录
    @GetMapping("/all/{current}/{size}")
    public ResponseInfo findAllBalance(@PathVariable("current") int current, @PathVariable("size") int size) {

        List<Balance> balancesList = balanceService.findAllBalance(current, size);

        ResponseInfo<Object> objectResponseInfo = new ResponseInfo<>();
        objectResponseInfo.setData(balancesList);
        objectResponseInfo.setCode(200);
        objectResponseInfo.setMessage("返回余额记录");
        objectResponseInfo.setStatus(ResponseStatus.SUCCESS);
        return objectResponseInfo;
    }

}
